<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>修改单词</title>

		<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css">
		<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
		<script src="${pageContext.request.contextPath}/js/admin/wordAdd.js"></script>
		
	</head>

	<body>
		<div style="height: 30px;"></div>
		<form class="form-horizontal" action="${pageContext.request.contextPath}/Word/wordUpdate?wordId=${updateWordAdmin.wordId}" method="post">
			<div class="form-group">
				<label class="col-sm-2 control-label">中文释义</label>
				<div class="col-sm-6">
					<input value="${updateWordAdmin.wordChinese}" autocomplete="off" type="text" name="wordChinese" class="form-control" id="wordChinese" placeholder="例：日语">
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">平假名</label>
				<div class="col-sm-6">
					<input value="${updateWordAdmin.wordPing}" autocomplete="off" type="text" name="wordPing" class="form-control nihonn" placeholder="例：にほんご">
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">片假名</label>
				<div class="col-sm-6">
					<input value="${updateWordAdmin.wordPian}" autocomplete="off" type="text" name="wordPian" class="form-control nihonn" placeholder="例：コンピュータ">
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">单用汉字</label>
				<div class="col-sm-6">
					<input value="${updateWordAdmin.wordWord}" autocomplete="off" type="text" name="wordWord" class="form-control" placeholder="例：日本語">
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">词性</label>
				<div class="col-sm-3">
					<select class="form-control" name="wordSex.wordSexId">
						<c:forEach items="${allWordSexAdmin}" var="wordSex">
							<c:if test="${wordSex.wordSexId == updateWordAdmin.wordSex.wordSexId}">
								<option value="${wordSex.wordSexId}" selected="selected">${wordSex.wordSexName}</option>
							</c:if>
							<c:if test="${wordSex.wordSexId != updateWordAdmin.wordSex.wordSexId}">
								<option value="${wordSex.wordSexId}">${wordSex.wordSexName}</option>
							</c:if>
						</c:forEach>
					</select>
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">等级</label>
				<div class="col-sm-3">
					<select class="form-control" name="grade.gradeId">
						<c:forEach items="${allGradeAdmin}" var="grade">
							<c:if test="${grade.gradeId == updateWordAdmin.grade.gradeId}">
								<option value="${grade.gradeId}" selected="selected">${grade.gradeName}</option>
							</c:if>
							<c:if test="${grade.gradeId != updateWordAdmin.grade.gradeId}">
								<option value="${grade.gradeId}">${grade.gradeName}</option>
							</c:if>
						</c:forEach>
					</select>
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">单词备注</label>
				<div class="col-sm-6">
					<textarea autocomplete="off" class="form-control" rows="3" name="wordContend">${updateWordAdmin.wordContend}</textarea>
			    </div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button id="submitButton" type="submit" class="btn btn-warning">修改</button>
				</div>
			</div>
		</form>
		
	</body>

</html>